package com.fen.controller;

import com.fen.entity.User;
import com.fen.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;
import java.util.List;

/**
 * @description:
 * @author: lrf
 * @create: 2019-05-31
 **/
@Controller
@RequestMapping("user")
public class UserController {

    @Resource
    private UserService userService;

    @RequestMapping("list")
    public ModelAndView index(){
        List<User> list = userService.selectAll();
        System.out.println("list = " + list);
        ModelAndView mv = new ModelAndView();
        mv.addObject("list", list);
        mv.setViewName("list");
        return mv;
    }
}